package be.webchess.www.dao;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;

public abstract class GenericDAO<obj> {

	protected Connection con;
	
	public GenericDAO ( Connection c )
	{
		con = c;		
	}
	
	public void commit() throws SQLException{
		this.con.commit();
	}
	
	public void rollback() throws SQLException{
		this.con.rollback();
	}	
	
	//
	
	public abstract obj findByID ( Long id ) throws SQLException;
	
	//public abstract List<obj>	findByCriteria ( String criteria ) throws SQLException;
	
	public abstract obj	insert ( obj o ) throws SQLException;
	
	public abstract obj update ( obj o ) throws SQLException;
	
	public abstract void delete ( obj o ) throws SQLException;
	
	public abstract List<obj> findAll () throws SQLException;
	
}
